package cn.javass.dp.iterator.example7;

import java.util.Collection;
import java.util.Iterator;

/**
 * 被客户收购的公司的工资管理类
 */
public class SalaryManager  {
    /**
     * 用数组管理
     */
    private PayModel[] pms = null;

    public PayModel[] getPms() {
        return pms;
    }

    public void calcSalary() {
        PayModel pm1 = new PayModel();
        pm1.setPay(2200);
        pm1.setUserName("王五");

        PayModel pm2 = new PayModel();
        pm2.setPay(3700);
        pm2.setUserName("赵六");

        PayModel pm3 = new PayModel();
        pm3.setPay(3700);
        pm3.setUserName("赵六3");

        PayModel pm4 = new PayModel();
        pm4.setPay(3700);
        pm4.setUserName("赵六4");

        PayModel pm5 = new PayModel();
        pm5.setPay(3700);
        pm5.setUserName("赵六5");

        PayModel pm6 = new PayModel();
        pm6.setPay(3700);
        pm6.setUserName("赵六6");

        PayModel pm7 = new PayModel();
        pm7.setPay(3700);
        pm7.setUserName("赵六7");

        pms = new PayModel[7];
        pms[0] = pm1;
        pms[1] = pm2;
        pms[2] = pm3;
        pms[3] = pm4;
        pms[4] = pm5;
        pms[5] = pm6;
        pms[6] = pm7;
    }


    public AggregationIterator createIterator() {
        return  new ArrayIteratorImpl(this);
    }
}
